package cn.hacynn.nd.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @Author Hacynn
 * @Date 2024/6/3 17:15
 * @Version 1.0
 * 配置类，用于管理线程池
 */

@Configuration
@Slf4j
public class ThreadPoolConfiguration {

    @Bean
    public ExecutorService executorService() {
        log.info("开始创建线程池...");
        return Executors.newFixedThreadPool(10); // 创建一个固定大小为 10 的线程池
    }
}
